/*
 * Created on 15 juin 2004
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package mygui;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

/**
 * @author glegarge
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class ActionSlower extends AbstractAction{

    private MonIHM _ihm;
    
    public ActionSlower (MonIHM ihm){
	_ihm = ihm;

	putValue(AbstractAction.NAME,"Slower");
	putValue(AbstractAction.SHORT_DESCRIPTION,"Make the simulation going slower");
	//putValue(AbstractAction.ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_SPACE,KeyEvent.CTRL_MASK ));
	putValue(AbstractAction.SMALL_ICON,UIM.createImageIcon("images/slower.png","Slower"));
	
    }

    public void actionPerformed(ActionEvent arg0) {
	_ihm._kernel.slowdown();
	_ihm._status._speed.setText("1/" + _ihm._kernel.getSpeed());
	_ihm.updateCommandes();
    }

}
